import java.util.Scanner;

//题目：输入某年某月某日，判断这一天是这一年的第几天？
public class Test14 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = console.nextInt();
        System.out.println("请输入月份");
        int month = console.nextInt();
        System.out.println("请输入日期");
        int day = console.nextInt();
        int a = 28;
        int sum = 0;
        //判断是否是闰年
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            a = 29;
        } else {
            a = 28;
        }
        switch (month) {
            case 1:
                sum += day;
                break;
            case 2:
                sum += 31 + day;
                break;
            case 3:
                sum += 31 + a + day;
                break;
            case 4:
                sum += 31 + a + 31 + day;
                break;
            case 5:
                sum += 31 + a + 31 + 30 + day;
                break;
            case 6:
                sum += 31 + a + 31 + 30 + 31 + day;
                break;
            case 7:
                sum += 31 + a + 31 + 30 + 31 + 30 + day;
                break;
            case 8:
                sum += 31 + a + 31 + 30 + 31 + 30 + 31 + day;
                break;
            case 9:
                sum += 31 + a + 31 + 30 + 31 + 30 + 31 + 31 + day;
                break;
            case 10:
                sum += 31 + a + 31 + 30 + 31 + 30 + 31 + 31 + 30 + day;
                break;
            case 11:
                sum += 31 + a + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + day;
                break;
            case 12:
                sum += 31 + a + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + day;
                break;
            default:
                System.out.println("请输入正确日期");
                break;
        }
        System.out.println(sum + "天");
    }
}
